package com.example.demo.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author admin
 * @version 1.0.0
 * @ClassName AlipayConfig.java
 * @Description TODO
 * @createTime 2020年10月09日 16:55:00
 */
public class AlipayConfig {// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号,开发时使用沙箱提供的APPID，生产环境改成自己的APPID
    public static String APP_ID = "2016102500758851";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCMbBCkSfek1ZmVW5c5dl4PaC8jx/C6jI75j6yyNzXSiTJhTLIin4aqD7PHeRvwQMGgllHNVVKjHoiDK6I0PK+9ygwfW90qUkcUSLYALc2lkZTIEMmB/iEn5Jix90BGePtRRWLvQb+WsfTeKu5DQX0dmIwQ2ncJb0ZHThyAaKCu4jdZE/8XvGY7+fK4FibDn+H+zzVxRxXe64mhI9bVEmqnmB4Dtn5/mn9QZTRr6ogl0vWcxbddsVjXElSSAPCIveSCHFeT/J3ssLyelTRFtChCwHzTQh5guDxJ61ru1CbZmeKivz4T+4sJrTupXLIQqsb79GpC+do86yzgewNM79mbAgMBAAECggEAKgpsjRNMHkCJA8txIhYLISe6/UZuDxvn7lWSiaS363mB6NmSd4U1RxL+axkaQTrR/acjhIsn+4g3rLXSkTseDn9AU98n/vS1LSB7xN/xssE8Pw2vlsij2pK5GIcC6lZsP6+7aBBSMObEfgNyZBZmRAcY4C7X9q4m51A+fj9U5CaKgDU8SU010/0UyxyYRPmhc2Z+JLq5fkoC1rENjmA/7MjS3czCk5TIIfA+7ItuqLJxUPzlsNsutHth/CVdg6oN6JFf3AyHFe5ywfgtF8+USF7luAR1GDbNUVaI5LKqwV3qFPSsmk4DKvhKKg6qjyen+BK8CRZrTXGsv4lnLEQcuQKBgQDDiJpWH7Cc827uSN4ZNluIvDQuDWzo2lPiqTtokDvUMFEaFdrEan1HFTEr5jDnZbzsgjUbXJ0RYbOWIeE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wdDFPBC62GQi1rspwBUy+XGhOhA3kYI9YuQ/mnjagwho+K754GifRFCr7ogZUKdY2rfbv2aJYepLR/uqtA4s6H8ac/J/LaO/BivxNehLKzBDX3Z5l3dLwIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost\n" +
            "    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问(其实就是支付成功后返回的页面)
    public static String return_url = "http://www.xzit.edu.cn/";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 支付宝网关，这是沙箱的网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
